package org.dtrd.modules.archive.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dtrd.common.api.dto.BasePatientRequest;
import org.dtrd.modules.archive.entity.po.DtrdEntRdArchiveReport;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 报告单
 *
 * @author xiao
 * @date 2022/9/9 11:33 AM
 */
@Data
@ApiModel("报告单")
@AllArgsConstructor
@NoArgsConstructor
public class ReportInfo extends BasePatientRequest {

    private Integer dataId;

    @NotEmpty
    @ApiModelProperty(value = "报告单链接数组")
    private List<String> reportUrls;

    @ApiModelProperty(value = "单张报告单链接，仅查询时使用")
    private String reportUrl;

    @NotNull
    @Range(min = 0, max = 3)
    @ApiModelProperty(value = "类型", notes = "不传，查询全部，0-未分组 1-既往病史，2-实验室，3-影像检测")
    private Integer type;

    public ReportInfo(Integer patientId, List<String> reportUrls, Integer type) {
        setPatientId(patientId);
        this.reportUrls = reportUrls;
        this.type = type;
    }


    public ReportInfo(DtrdEntRdArchiveReport po) {
        dataId = po.getDataId();
        setPatientId(po.getPatientId());
        reportUrl = po.getReportUrls();
        type=po.getReportType();
    }

}
